home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / regkey22.zip / MAKEKEY.C < prev    next >
C/C++ Source or Header  |  1992-12-21  |  2KB  |  53 lines

  1. /* Program to generate registration key codes for use with the BP?.LIB
  2.  * registration key decoding algorithm. When compiled, this program should
  3.  * be linked with the BP?.LIB file, by adding the name of this program and
  4.  * the BP?.LIB file to a project / make file.
  5.  */
  6.  
  7.  
  8. #include "bp.h"
  9.  
  10. #include <stdio.h>
  11. #include <string.h>
  12.  
  13. main()
  14.    {
  15.    char temp_string[80];
  16.    unsigned int security_code;
  17.    unsigned int security_verification;
  18.    char registration_string[201];
  19.    char registration_verification[201];
  20.  
  21.    printf("MAKEKEY 2.20 - (C) Copyright 1992, Brian Pirie. All Rights Reserved.\n\n");
  22.  
  23.    printf(" Please Enter Program's Unique Security Code : ");
  24.    gets(temp_string);
  25.    security_code=atoi(temp_string);
  26.    printf("                      Again For Verification : ");
  27.    gets(temp_string);
  28.    security_verification=atoi(temp_string);
  29.    if(security_code!=security_verification)
  30.       {
  31.       printf("\nCodes do not match!\n");
  32.       return(1);
  33.       }
  34.  
  35.    printf("           Registration String (User's Name) : ");
  36.    gets(registration_string);
  37.    printf("                      Again For Verification : ");
  38.    gets(registration_verification);
  39.    if(strcmp(registration_string,registration_verification)!=0)
  40.       {
  41.       printf("\nStrings do not match!\n");
  42.       return(1);
  43.       }
  44.  
  45.    printf("\n---------------------------------------------------------------------------\n");
  46.    printf("GENERATED REGISTRATION KEY :\n\n");
  47.    printf("            Registration String : [%s]\n",registration_string);
  48.    printf("               Registration Key : [%lu]\n",bp(registration_string,security_code));
  49.    printf("---------------------------------------------------------------------------\n");
  50.  
  51.    return(0);
  52.    }
  53.